<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title></title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover, minimum-scale=1.0,shrink-to-fit=no,user-scalable=no">
  <meta name="renderer" content="webkit">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="mobile-web-app-status-bar-style" content="white">
  <meta name="referrer" content="no-referrer" />
  <script defer="defer">
    window.lobby_utils = {
      preventZoom(){
          var e = 0;
          document.addEventListener("touchstart", (function(e) {
              e.touches.length > 1 && e.preventDefault()
          }
          )),
          document.addEventListener("touchend", (function(t) {
              var i = (new Date).getTime();
              i - e <= 300 && t.preventDefault(),
              e = i
          }
          ), !1),
          document.addEventListener("gesturestart", (function(e) {
              e.preventDefault()
          }
          ))
      },
      detectDeviceType() {
        var e = navigator.userAgent
          , t = () => e.match(/(iPad)/) || !e.match(/(iPhone\sOS)\s([\d_]+)/) && window.screen.height > window.screen.width && /macintosh|mac os x/i.test(e)
          , o = () => /iPhone|Android.+Mobile/.test(e) || navigator.maxTouchPoints && navigator.maxTouchPoints > 1 && /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);
        return {
          tablet: t,
          mobile: o,
          desktop: () => !t() && !o()
        }
      },
      mediaScreen() {
        const device = lobby_utils.detectDeviceType();
        const isTablet = device.tablet();
        const isDesktop = device.desktop();
        const width = window.innerWidth;
        const height = window.innerHeight;
        // 基准比例 (iPhone 6/7/8, 750x1334)
        const baseRatio = 750 / 1334;
        // 默认值
        let deviceType = "mobile";
        let nodeDesktop = "0"; // 1 表示移动端但宽度较大
        let screenSize = "small";
        // 计算可用宽度，按比例缩放
        const scaledWidth = width / height > baseRatio ? baseRatio * height : width;
        // PC 端逻辑
        if (width > 450 && !isTablet) {
          nodeDesktop = "1";
          if (window.location.search.includes("mock.openPC")) {
            if (width > 1200 && isDesktop) {
              screenSize = "large";
            } else if (width > 750 && isDesktop) {
              screenSize = "medium";
            }
            deviceType = "desktop";
            nodeDesktop = "0";
          }
        }
        // 设置 HTML 根节点的属性和变量
        const root = document.documentElement;
        if (root) {
          root.style.setProperty("--theme-max-width", nodeDesktop === "1" ? `${scaledWidth}px` : "100%");
          root.style.setProperty("--theme-vh", `${height * 0.01}px`);
          root.style.setProperty("--theme-min-width", "320px");
          root.style.setProperty("--theme-rem-unit", "100");
          root.style.setProperty("--theme-px", "1px");
          root.setAttribute("data-device-nodesktop", nodeDesktop);
          root.setAttribute("data-device", deviceType);
        }
        return {
          device: deviceType,
          size: screenSize,
          nodesktop: nodeDesktop
        }
      }
    }
    lobby_utils.mediaScreen()
    window.addEventListener('resize', (function(){
      lobby_utils.mediaScreen()
    }))
    lobby_utils.preventZoom()
  </script>
</head>
<body>
  <div id="app"></div>
  <script type="module" src="/src/main.js"></script>
  <!-- 开启底部安全区适配 -->
  <!-- <van-number-keyboard safe-area-inset-bottom /> -->
</body>
</html>